package com.xzg.erp.process.service.impl;

import com.xzg.erp.process.service.MyTaskService;
import lombok.extern.slf4j.Slf4j;
import org.flowable.engine.TaskService;
import org.flowable.task.api.Task;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

@Slf4j
@Service
public class MyTaskServiceImpl implements MyTaskService {

    @Autowired
    private TaskService taskService;

    @Override
    @Transactional
    public List<Task> getTasks(String assignee) {
        return taskService.createTaskQuery().taskAssignee(assignee).list();
    }

    @Override
    public List<Task> pageTasks() {
        return taskService.createTaskQuery().list();
    }
}
